<?php 
require_once('header_redirection.php');
require_once('Class/connexionDB.Class.php');

$db = new connexionDB();

if (isset($_POST['add']) && $_POST['add'] != '' && isset($_POST['topic']) && $_POST['topic'] != '')
{
	if ($_POST['add'] == 'topic')
	{
		$db->addNewTopic($_POST['topic']);
	}
}
else if (isset($_POST['topicDel']) && $_POST['topicDel'] != '')
{
	if ($_POST['del'] == 'topic')
	{
		$db->delTopic($_POST['topicDel']);
	}
}
else if (isset($_POST['addGroup']) && $_POST['addGroup'] != '')
{
	$db->addGroup($_POST['addGroup']);
}
else if (isset($_POST['selectGroup']) && $_POST['selectGroup'] != '')
{
	$db->delGroup(intval($_POST['selectGroup']));
}
else if (isset($_POST['addUnacceptable']) && $_POST['addUnacceptable'] != '')
{
	$db->addUnacceptable($_POST['addUnacceptable']);
}
else if (isset($_POST['deleteUnacceptable']) && $_POST['deleteUnacceptable'] != '')
{
	$db->delUnacceptable(intval($_POST['deleteUnacceptable']));
}
else if (isset($_POST['addRecipient']) && $_POST['addRecipient'] != '')
{
	$db->addRecipient($_POST['addRecipient']);
}
else if (isset($_POST['selectRecipient']) && $_POST['selectRecipient'] != '')
{
	$db->delRecipient(intval($_POST['selectRecipient']));
}
else if (isset($_POST['addCountry']) && $_POST['addCountry'] != '')
{
	$db->addCountry($_POST['addCountry']);
}
else if (isset($_POST['selectCountry']) && $_POST['selectCountry'] != '')
{
	$db->delCountry(intval($_POST['selectCountry']));
}
else if (isset($_POST['consultant']) && $_POST['consultant'] != '')
{
	$db->addConsultant($_POST['consultant']);
}
else if (isset($_POST['ccDel']) && $_POST['ccDel'] != '')
{
	$db->delConsultant($_POST['ccDel']);
}

header('Location: administration.php');
exit();
?>